package com.pactera.asmp.server.service;

import com.pactera.asmp.server.entity.UserRolesVO;
import com.pactera.asmp.server.entity.UserSearchDTO;
import com.pactera.asmp.server.pojo.User;
import com.pactera.asmp.server.utils.PageDataResult;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface UserService {
	/**
	 * 分页查询用户列表
	 * @param page
	 * @param limit
	 * @return
	 */
	PageDataResult getUsers(UserSearchDTO userSearch, int page, int limit);

	/**
	 *	设置用户【新增或更新】
	 * @param user
	 * @param roleIds
	 * @return
	 * @throws Exception 
	 */
	String setUser(User user, List<Integer> roleIds) throws Exception;


	/**
	 * 删除用户
	 * @param id
	 * @param isDel
     * @param request
	 * @return
	 */
	String setDelUser(Integer id, Integer isDel, Integer insertUid,
                      Integer version, HttpServletRequest request);

	/**
	 * 查询用户数据
	 * @param id
	 * @return
	 */
	UserRolesVO getUserAndRoles(Integer id);


	/**
	 * 根据手机号查询用户数据
	 * @param mobile
	 * @return
	 */
	User findUserByMobile(String mobile);

	User findUserByUserName(String userName);

	/**
	 * 修改用户手机号
	 * @param id
	 * @param password
	 * @return
	 */
	int updatePwd(Integer id, String password);

	/**
	 * 锁定用户
	 * @param id
	 * @param isLock  0:解锁；1：锁定
	 * @return
	 */
	int setUserLockNum(Integer id, int isLock);

	User findUserById(Integer id);

	/**
	 * 登出
	 * @param request
	 */
    void logout(HttpServletRequest request);

    /**
     * 导出用户信息
     * 
     * @param userSearch
     * @param response
     */
    void export(UserSearchDTO userSearch, HttpServletResponse response);

    /**
     * 获取用户关联项目
     * 
     * @return
     */
    List<Integer> getRelatedProject();
}
